package com.example.demo.util;

import java.io.ByteArrayInputStream;
import java.io.ObjectInputStream;

public class ByteObj {

	 public static Object getObjectFromBytes(byte[] objBytes) throws Exception { 
		 if (objBytes == null || objBytes.length == 0) { 
			 return null; 
			 } 
		 ByteArrayInputStream bi = new ByteArrayInputStream(objBytes); 
		 ObjectInputStream oi = new ObjectInputStream(bi); 
		 return oi.readObject(); 
		 }

}
